from selenium import webdriver
from selenium.webdriver.chrome.webdriver import WebDriver
from selenium.webdriver.common.by import By


# 基础类，封装一些selenium的常规操作
class Base():

    def __init__(self,driver=WebDriver):
        self.driver = driver

    # 定位一个元素
    def find_to_ele(self,xpath):
        ele = self.driver.find_element(By.XPATH,xpath)
        return ele

    # 定位多个元素
    def find_to_eles(self,xpath):
        eles = self.driver.find_element(By.XPATH,xpath)
        return eles
